package tau.pimpmyfreedb.common.types;

import tau.pimpmyfreedb.dal.DataType;
import tau.pimpmyfreedb.dal.IDataItem;

public class Track extends MusicItem {
    public static final int UKNOWN_ALBUM_ID = -1;
    private TrackLength length;
    private int albumID;

    // constructors

    public Track(int id, String name, int albumID, TrackLength length,
	    String extendedData) throws IllegalArgumentException {
	super(id, name, extendedData);
	this.albumID = albumID;
	this.length = length;
    }

    public Track(String name) {
	this(IDataItem.NewItemId, name, Track.UKNOWN_ALBUM_ID, null, null);
    }

    public TrackLength getLength() {
	return length;
    }

    public int getAlbumID() {
	return albumID;
    }

    @Override
    public DataType getDataType() {
	return DataType.TRACK;
    }

}